package com.hk.controller;


import com.hk.service.business.asyn.AsynTaskService;
import com.hk.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
@Slf4j
public class SyncTaskController {

    @Autowired
    private AsynTaskService asynTaskService;

    @GetMapping("sync")
    public R testSync() {
        log.info("start~~~~~~~~~");
        //异步执行
        asynTaskService.executeAsyncTask();
        log.info("end~~~~~~~~~");
        return R.ok();
    }


}
